package com.sat.common.utils.logger;

public class LoggerConfig {

    private String appTag;
    private boolean isLoggable;
    private boolean showThreadInfo;
    private int methodOffset;
    private int methodCount;

    private LoggerConfig(Builder mBuilder) {
        this.appTag = mBuilder.appTag;
        this.isLoggable = mBuilder.isLoggable;
        this.showThreadInfo = mBuilder.showThreadInfo;
        this.methodOffset = mBuilder.methodOffset;
        this.methodCount = mBuilder.methodCount;
    }

    public String getAppTag() {
        return appTag;
    }

    public boolean isLoggable() {
        return isLoggable;
    }

    public boolean isShowThreadInfo() {
        return this.showThreadInfo;
    }

    public int getMethodCount() {
        return this.methodCount;
    }

    public int getMethodOffset() {
        return this.methodOffset;
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public static class Builder {

        String appTag;
        boolean isLoggable;
        boolean showThreadInfo;
        int methodOffset = 5;
        int methodCount = 2;

        public LoggerConfig build() {
            return new LoggerConfig(this);
        }

        public Builder tag(String appTag) {
            this.appTag = appTag;
            return this;
        }

        public Builder isLoggable(boolean isLoggable) {
            this.isLoggable = isLoggable;
            return this;
        }

        public Builder showThreadInfo(boolean showThreadInfo) {
            this.showThreadInfo = showThreadInfo;
            return this;
        }

        public Builder methodOffset(int methodOffset) {
            this.methodOffset = methodOffset;
            return this;
        }

        public Builder methodCount(int methodCount) {
            this.methodCount = methodCount;
            return this;
        }
    }
}
